package com.example.restaurantfinder.model;

import android.os.Parcel;
import android.os.Parcelable;


public class RestaurantInfo implements Parcelable {
	
    private String id;
    private String name;
    private String reference;
    private String icon;
    private String vicinity;
    private double rating;
    private String url;
    private String  website;
    private String formatted_address;
    private String formatted_phone_number;
    private double lat;
    private double lng;
    private double curr_lat;
    private double curr_lng;
    
    
    // Empty constructor
    public RestaurantInfo(){
 
    }
    public RestaurantInfo(Parcel in) {
		readFromParcel(in);
	}
    
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getReference() {
		return reference;
	}
	public void setReference(String reference) {
		this.reference = reference;
	}
	public String getIcon() {
		return icon;
	}
	public void setIcon(String icon) {
		this.icon = icon;
	}
	public String getVicinity() {
		return vicinity;
	}
	public void setVicinity(String vicinity) {
		this.vicinity = vicinity;
	}
	
	public double getRating() {
		return rating;
	}
	public void setRating(double rating) {
		this.rating = rating;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public String getWebsite() {
		return website;
	}
	public void setWebsite(String website) {
		this.website = website;
	}
	public String getFormatted_address() {
		return formatted_address;
	}
	public void setFormatted_address(String formatted_address) {
		this.formatted_address = formatted_address;
	}
	public String getFormatted_phone_number() {
		return formatted_phone_number;
	}
	public void setFormatted_phone_number(String formatted_phone_number) {
		this.formatted_phone_number = formatted_phone_number;
	}
	public double getLat() {
		return lat;
	}
	public void setLat(double lat) {
		this.lat = lat;
	}
	public double getLng() {
		return lng;
	}
	public void setLng(double lng) {
		this.lng = lng;
	}
	
	public double getCurr_lat() {
		return curr_lat;
	}
	public void setCurr_lat(double curr_lat) {
		this.curr_lat = curr_lat;
	}
	public double getCurr_lng() {
		return curr_lng;
	}
	public void setCurr_lng(double curr_lng) {
		this.curr_lng = curr_lng;
	}
	@Override
	public int describeContents() {
		// TODO Auto-generated method stub
		return 0;
	}
	
	
	@Override
	public void writeToParcel(Parcel dest, int flags) {
		// TODO Auto-generated method stub
		
		dest.writeString(this.id);
		dest.writeString(this.name);
		dest.writeString(this.reference);
		dest.writeString(this.icon);
		dest.writeString(this.vicinity);
		dest.writeString(Double.toString(this.rating));
		dest.writeString(this.url);
		dest.writeString(this.website);
		dest.writeString(this.formatted_address);
		dest.writeString(this.formatted_phone_number);
		dest.writeString(Double.toString(this.lat));
		dest.writeString(Double.toString(this.lng));
		dest.writeString(Double.toString(this.curr_lat));
		dest.writeString(Double.toString(this.curr_lng));
		
				
	}
	
private void readFromParcel(Parcel in) {
		
		this.id = in.readString();
		this.name = in.readString();
		this.reference = in.readString();
		this.icon = in.readString();
		this.vicinity = in.readString();
		this.rating = Double.parseDouble(in.readString());
		this.url = in.readString();
		this.website = in.readString();
		this.formatted_address = in.readString();
		this.formatted_phone_number = in.readString();
		this.lat = Double.parseDouble(in.readString());
		this.lng = Double.parseDouble(in.readString());
		this.curr_lat = Double.parseDouble(in.readString());
		this.curr_lng = Double.parseDouble(in.readString());
		
		
	}

	public static final Parcelable.Creator CREATOR =
	new Parcelable.Creator() {
        public RestaurantInfo createFromParcel(Parcel in) {
            return new RestaurantInfo(in);
        }

        public RestaurantInfo[] newArray(int size) {
            return new RestaurantInfo[size];
        }
    };
}


